#include <iostream>
#include <string>

using std::cout;
using std::endl;
using std::string;

class WindowInterface {
	public:
		virtual void draw() = 0;
		virtual string info() = 0;
};


class SimpleWindow : public WindowInterface {
	public:
		void draw() {
			cout << "drawing simple window" << endl;	
		}


		string info() {
			return "Simple window";
		}
};


class HScrollWindow:  public WindowInterface {
	protected:
			 WindowInterface* decratedWindow;

	public:
		HScrollWindow(WindowInterface* w) : decratedWindow(w){}

		void draw() {
			decratedWindow->draw();
			cout << "drawing horiontal scroll bar!" << endl;	
		}


		string info() {
			return decratedWindow->info() + ", with Horizontal scroll bar";
		}
};


class VScrollWindow:  public WindowInterface {
	protected:
			 WindowInterface* decratedWindow;

	public:
		VScrollWindow(WindowInterface* w) : decratedWindow(w){}

		void draw() {
			decratedWindow->draw();
			cout << "drawing vertical scroll bar!" << endl;	
		}


		string info() {
			return decratedWindow->info() + ", with Vertical scroll bar";
		}
};


int main(){
	// WindowInterface* w=new SimpleWindow();
	SimpleWindow w;
	HScrollWindow hw(&w);
	VScrollWindow vw(&hw);

	// w->draw();
	// cout << w->info() <<endl;

	hw.draw();
	cout << hw.info() <<endl;

	vw.draw();
	cout << vw.info() <<endl;

	HScrollWindow hw1(&vw);
	hw1.draw();
	cout << hw1.info() <<endl;
	// delete (SimpleWindow*) w;
	
	WindowInterface* wp=&hw;

	wp->draw();
	cout << wp->info() <<endl;


	return 0;
}
